/* 
* sepacf.h - This file is a part of the sep-library 
*
* Copyright (C) 2008 Jesper Schmidt Hansen 
* 
* License: GPL - see COPYING for copying conditions.
* There is ABSOLUTELY NO WARRANTY, not even for MERCHANTIBILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* Contact: schmidt@zigzak.net
*/


#ifndef __SEPACF_H__
#define __SEPACF_H__

#include "separray.h"
#include "sepstrct.h"
#include "seplinmol.h"


/**
* Evaulates the atomic velocity autocorrelation function for 2D and 3D 
* systems.  Warning: Uses static variables so use with care   
* @param *ptr Pointer to seppart
* @param type The type/label of the atoms under study
* @param *vac The vector holding the data
* @param lvec Length of the vector
* @param *ncall Acummulates the number of samples
* @param opt Option: 0 for sampling  1 for averaging
* @param npart Number of atoms in the system
* @param ndim Number of dimensions
* @return 1 if one sampling is done 0 otherwise (used to controlle the number
* of samples)
*/
int sep_sample_avacf(seppart *ptr, char type, double *vac, unsigned int lvec, 
                    long unsigned int *ncall, int opt, int npart, int ndim);

/**
* Evaluates the autocorrelation function of the atomic xy pessure tensor 
* element. Warning: Uses static variables so use with care   
* @param *ptr Pointer to seppart
* @param type The type/label of the atoms under study
* @param *pxy Vector holding the data
* @param lvec Length of the vector
* @param (*fun) Pointer to the pair force function
* @param cf Cut-off
* @param *ncall Acummulates the number of samples
* @param opt Option: 0 for sampling  1 for averaging
* @param sys 3D sys specifications
*/
int sep_3D_sample_apacf(seppart *ptr, char type, double *pxy, int lvec,
                        double (*fun)(double, char), double cf,
                        unsigned long int *ncall, int opt, sep3D sys);

/**
* Evaluates autocorrelation function of the atomic xy pessure tensor element.
* Warning: Uses static variables so use with care  
* @param *ptr Pointer to seppart
* @param type The type/label of the atoms under study
* @param *pxy Vector holding the data
* @param lvec Length of the vector
* @param (*fun) Pointer to the pair force function
* @param cf Cut-off
* @param *ncall Acummulates the number of samples
* @param opt Option: 0 for sampling  1 for averaging
* @param sys 3D sys specifications
*/                     
int sep_2D_sample_apacf(seppart *ptr, char type, double *pxy, int lvec,
                         double (*fun)(double, char), double cf,
                         unsigned long int *ncall, int opt, sep2D sys);
                         
/** 
* Evaluates the autocorrelation functions of the traceless
* symmetric part and anitsymmetric part of molecular pessure tensor.
* Warning: Uses static variables so use with care   
* @param *ptr Pointer to seppart
* @param type The type/label of the atoms under study
* @param *pacf_os Vector holding the data for the symmetric part
* @param *pacf_as Vector holding the data for the antisymmetric part
* @param lvec Length of the vectors
* @param (*fun) Pointer to the pair force function
* @param cf Cut-off
* @param nmol Number of molecules in the system
* @param nau Number of united atoms per molecule
* @param *ncall Acummulates the number of samples
* @param opt Option: 0 for sampling  1 for averaging
* @param sys 3D sys specifications
*/                      
double sep_3D_sample_mpacf(seppart *ptr, char type, 
                          double *pacf_os, double *pacf_as, int lvec,  
                          double (*fun)(double, char), const double cf,
                          int nmol, int nua, unsigned long int *ncall, 
                          int opt, sep3D sys);
                         
                         
#ifndef DOXYGEN_SKIP
double sep_eval_avacf(seppart *ptr, char type, double **vel0, 
                     int opt, int npart, int ndim);
double sep_apacf_kin(seppart *ptr, char type, int npart);
double sep_3D_apacf_nonbon(seppart *ptr, char type, double (*fun)(double, char),
                          double cf, sep3D sys);

void sep_3D_eval_apress(seppart *ptr, double **P, char type, 
                         double (*fun)(double, char),
                       double cf, sep3D sys);

void sep_3D_eval_mpress(seppart *ptr, double **P, char type, 
                        double (*fun)(double, char), const double cf,  
                        int nbeads, int npoly, sep3D sys);

double sep_2D_apacf_nonbon(seppart *ptr, char type, double (*fun)(double, char),
                          double cf, sep2D sys);

char *sep_acaf_warning( void );
#endif
                       
                
#endif 
    
